/// 将图片复制到剪贴板（macOS）
#[cfg(target_os = "macos")]
pub fn copy_image_to_clipboard(file_path: &str) -> Result<(), String> {
    use std::process::Command;
    
    // 使用 osascript 将图片复制到剪贴板
    let script = format!(
        r#"set the clipboard to (read file POSIX file "{}" as «class PNGf»)"#,
        file_path.replace('"', "\\\"")
    );
    
    let output = Command::new("osascript")
        .arg("-e")
        .arg(&script)
        .output()
        .map_err(|e| format!("执行 AppleScript 失败: {}", e))?;
    
    if !output.status.success() {
        let error_msg = String::from_utf8_lossy(&output.stderr);
        return Err(format!("复制到剪贴板失败: {}", error_msg));
    }
    
    Ok(())
}

/// 将图片复制到剪贴板（非 macOS 平台）
#[cfg(not(target_os = "macos"))]
pub fn copy_image_to_clipboard(_file_path: &str) -> Result<(), String> {
    // 其他平台暂不支持
    Ok(())
}

